package com.honey.solr.analyzer;

import com.honey.compilation.xml.XmlElement;

public class IKAnalyzer extends ChineseAnalyzer{
	
	@Override
	public XmlElement getIndexTokenizer() {
		XmlElement analyzer = new XmlElement("analyzer").addAttribute("type", "index"); 
		new XmlElement(analyzer,"tokenizer")
		.addAttribute("class", "org.wltea.analyzer.solr.IKTokenizerFactory")
		.addAttribute("useSmart","true")
		;
		return analyzer;
	}
	@Override
	public XmlElement getQueryTokenizer() {
		XmlElement analyzer = new XmlElement("analyzer").addAttribute("type", "query"); 
		new XmlElement(analyzer,"tokenizer")
		.addAttribute("class", "org.wltea.analyzer.solr.IKTokenizerFactory")
		.addAttribute("useSmart","true")
		;
		
		new XmlElement(analyzer,"filter")
		.addAttribute("class", "solr.SynonymFilterFactory")
		.addAttribute("synonyms", "synonyms.txt")
		.addAttribute("ignoreCase", "true")
		.addAttribute("expand", "true")
		;
		return analyzer;
	}
	@Override
	public String getXmlDoc() {
		
		return "ik-analyzer中文词法分析器. 分词算法是\"正向迭代最细粒度切分算法\".";
	}
	
}
